<template>
    <h2 style="text-align: center;">用户登录列表</h2>
    <table border="1">
        <tr>
            <td>账号ID</td>
            <td>账号</td>
            <td>密码</td>
            <td>注册时间</td>
        </tr>
        <tr v-for="i in info">
            <td>{{ i.Uid }}</td>
            <td>{{ i.Uname }}</td>
            <td>{{ (i.Upwd).substring(0,4)}}***</td>
            <td>{{ (i.Udate).substring(0,10) }}</td>
        </tr>
    </table>
</template>
<script setup lang="ts">
import {ref,onMounted} from 'vue'
import axios from 'axios'

const info =ref([{
    Uid:"",
    Uname:"",
    Upwd:"",
    Udate:""
}])

onMounted(()=>{
    show()
})

const show =()=>{
    axios({
        url:"http://localhost:52342/api/User/UserShow",
        method:"get",
    })
    .then((res)=>{
        console.log(res.data)
        info.value=res.data
    })
    .catch((err)=>{
        console.log(err)
    })
}


</script>